<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/commons/include.inc.jsp" %>
 
 <%--
	模块：${model.comment}
--%>
<div style="width: 98%;margin: 0 auto;" >
	<form  action="${model.modelL}/save.do" method="post" enctype="multipart/form-data"  onsubmit="return validateSubmitForm(this)">
		  <table class="table table-bordered ">	 
#foreach( $field in $fieldList )
#if($field.isPk != "Y"&&${field.inputType}!="none"&&${field.inputType}=="hidden")
            <input type="hidden"  name="${field.field}"   value="${${model.modelL}.${field.field}}"/>
#end
#if($field.isPk != "Y"&&${field.inputType}!="hidden"&&${field.inputType}!="none")
                     <tr>
                        <th>#if(!$field.nullable)#end${field.comment}：</th>
                         <td>
#if(${field.inputType}=="input")
#if("$field.inputValueOne" == "sy_users")
						<a  href="user/lookUpPage.do?type=2" lookupGroup="user" title="用户查询">
						<textarea  readonly="readonly"  toName="user.trueName"  rows="2" style="width: 400px"><my:outTrueName id="${${model.modelL}.${field.field}}"/></textarea>
						</a>
						<input type="hidden"  name="${field.field}" toName="user.id"  value="${${model.modelL}.${field.field}}"/>
						<a class="easyui-linkbutton clearLookup"  icon="icon-cancel"	plain="true"  href="javascript:;"  clearLookup="user"  title="清空"></a>
				
#elseif("$field.inputValueOne" == "sy_dept")
						<a  href="dept/lookUpPage.do?type=2" lookupGroup="dept"  title="部门查询">
							<textarea  readonly="readonly"  toName="dept.deptName"  rows="2" style="width: 400px" ><my:outDeptName id="${${model.modelL}.${field.field}}" /></textarea>
						</a>
						<input type="hidden" name="${field.field}" toName="dept.id" value="${${model.modelL}.${field.field}}"/>
				
						<a class="easyui-linkbutton clearLookup"  icon="icon-cancel"	plain="true"  href="javascript:;"  clearLookup="dept"  title="清空"></a>
					
#else
                        <input type="text"  name="${field.field}" placeholder="请输入${field.comment}" #if($field.validate=="mobile")data-options="validType:['mPhone']" maxlength="11" required="true" #elseif($field.validate=="email")lay-verify="email"#elseif($field.validate=="url")lay-verify="url"#elseif($field.validate=="identity")lay-verify="identity"#elseif(!$field.nullable)class="easyui-validatebox"  required="true" #end value="${${model.modelL}.${field.field}}"  />
#end
#elseif(${field.inputType}=="textarea")
                         <textarea  style="width: 98%" name="${field.field}"  placeholder="请输入${field.comment}" #if(!$field.nullable)class="easyui-validatebox"#end value="${${model.modelL}.${field.field}}" >${${model.modelL}.${field.field}}</textarea>
#elseif(${field.inputType}=="htmleditor")
                       <textarea  class="editor" style="width: 98%" name="${field.field}"  placeholder="请输入${field.comment}" #if(!$field.nullable)class="easyui-validatebox"#end value="${${model.modelL}.${field.field}}">${${model.modelL}.${field.field}}</textarea>
#elseif(${field.inputType}=="checkbox")
                        <input   type="checkbox"  name="${field.field}" placeholder="请输入${field.comment}" #if(!$field.nullable)lay-verify="required"#end  value="${${model.modelL}.${field.field}}"/>
#elseif(${field.inputType}=="radio")
                        <input    type="radio"  name="${field.field}" placeholder="请输入${field.comment}" #if(!$field.nullable)lay-verify="required"#end  value="${${model.modelL}.${field.field}}"/>
#elseif(${field.inputType}=="time")
                       <input name="${field.field}" type="text"  #if(!$field.nullable)lay-verify="required"#end placeholder="请选择时间" class="td_input require" onFocus="WdatePicker({dateFmt:'HH:mm:ss'})" value='${${model.modelL}.${field.field}}'/>
#elseif(${field.inputType}=="date")
                       <input name="${field.field}" type="text"  #if(!$field.nullable)lay-verify="required"#end placeholder="请选择日期" class="td_input require" readonly="readonly" onfocus="WdatePicker();" value='<fmt:formatDate value="${${model.modelL}.${field.field}}" pattern="yyyy-MM-dd" />'/>
#elseif(${field.inputType}=="datetime")
                       <input name="${field.field}" type="text"    #if(!$field.nullable)lay-verify="required"#end placeholder="请选择日期时间" type="text" class="td_input require" readonly="readonly" onfocus="WdatePicker();"  value='<fmt:formatDate value="${${model.modelL}.${field.field}}" pattern="yyyy-MM-dd HH:mm:ss" />'/>
#elseif(${field.inputType}=="file")
						<table class="table table-bordered itemDetail" addButton="添加"  style="width:100%;margin-top: 0;"
						template='
							<tr>
					 			<td style="text-align: center;"><div class="itemDetail-rownumber">1</div></td>
								<td ><input type="file" fileupload="no" class="easyui-validatebox"  required="true" name="file[#index#]"  /></td>
								<td style="text-align: center;"><a href="javascript:;" class="btnDel"  title="删除"></a></td>	
							</tr>
						'>
						<thead>
							<tr>
								 <th width="35" style="text-align: center;">序号</th>
								 <th style="text-align: center;">附件</th>
							 	 <th width="35" style="text-align: center;">删除</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach  var="m"  items="${ requestScope.fileList}" varStatus="status">
								<tr>	
										<td style="text-align: center;"><div class="itemDetail-rownumber">${ status.count}</div></td>
										<td><c:out value="${ m.fileName}"/></td>
										<td>
											<a class="btnDel"  href="${model.modelL}/delFile.do?id=${ m.id}"  title="请谨慎操作!!此操作为动态删除,会立即执行删除附件操作,您确认删除吗?"></a>
										</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
#elseif(${field.inputType}=="select")
#if("$!field.inputValueOne" == "")
                        <select name="${field.field}" class="easyui-validatebox" sValue="${${model.modelL}.${field.field}}" required="true" >
							<option value="">==请选择${field.comment}==</option>
							<my:outOptions type="${field.inputValue}"/>	
						</select>
#else
						<select id="${field.field}" name="${field.field}" class="easyui-validatebox" sValue="${${model.modelL}.${field.field}}" required="true" >
							<option value="">==请选择${field.comment}==</option>
							<c:forEach items="${${field.inputValueOneL}EntityList}" var="item">
							<option value="${ item.code}" <c:if test="${ item.code==${model.modelL}.${field.field}}">selected = "selected"</c:if>>${ item.${field.inputValueTwo}}</option>
							</c:forEach>
						</select>
#end
#end
                        </td>
                  </tr>
#end
#end
				<tr>
					<th></th>
					<td>
						<div  style="margin-top: 10px;margin-bottom: 10px;">
							  <button type="submit" class="btn btn-primary" >保存</button>&nbsp;&nbsp;&nbsp;&nbsp;
							  <button type="button" class="btn clear" >清空</button>
						</div>
					</td>
				 </tr>
		 
		 </table>
		<input type="hidden" name="id" value="${ ${model.modelL}.id}"/>
		<input type="hidden" name="datagridId" value="${ param.rel }_datagrid" />	
		<input type="hidden" name="currentCallback" value="close" />
		 
	</form>
	
	
</div>